<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<p id="p1"><span>hello javascript</span></p>
<input type="text" id="inpt" value="super">


<script>
    // var  ele_p = document.getElementsByTagName('p')
    // console.log(ele_p[0].innerHTML)
    var ele_p = document.getElementById('p1')
    // 节点内容操作   获取html标签
    console.log(ele_p.innerHTML)
    //节点内容操作   获取文本内容
    console.log(ele_p.innerText)

    // 动态赋值  标签会被作为纯文本处理
    // ele_p.innerText = "<span>hi javascript</span>"
    ele_p.innerHTML = "<span>hi javascript</span>"
    // 获取表单对象中的值  value 属性
    var inpt = document.getElementById('inpt')
    console.log(inpt)
    console.log(inpt.value)
    // 表单对象赋值
    inpt.value = 'admin'

</script>


</body>
</html>